public abstract class AbstractLogger {
    public static int INFO = 1;
    public static int DEBUG = 2;
    public static int ERROR = 3;

    public int level;

    public AbstractLogger nextLogger;

    public void setNextLogger(AbstractLogger nextlogger) {
        this.nextLogger = nextlogger;
    }

    public void logMsg(int level, String msg) {
        if (this.level <= level) {
            writeLog(msg);
        }

        if (nextLogger != null) {
            nextLogger.logMsg(level, msg);
        }
    }

    abstract public void writeLog(String msg);
}
